<!-- application/views/scripts/level/add-level.phtml -->

<div id="section-content">
<h2>Admin > Edit level</h2>
Please, complete the form below.

<?php
$this->form->setAction($this->url()."?level_id=".$this->level_id);
echo $this->form;

?>

<h3>Tests</h3>

<table class="general-table ui-widget ui-widget-content table" cellspacing="0" id="questions-table">
<thead>
    <tr class="ui-widget-header">
        <th>Test</th>
        <th><a href="<? echo $this->baseUrl() ?>/test/add-test"><div class="ui-state-default ui-corner-all" title="New test" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-plus"></span></div></a></th>
    </tr>
</thead>
<tbody>


    <?php

    if (count($this->tests) == 0) {
        ?>
        <tr id="no-tests">
            <td>There is no tests.</td>
        </tr>
    <?php
    }

    $class = "odd";
    foreach ($this->tests as $entry):
        $class = ($class=='even') ? 'odd' : 'even';
    ?>
        <tr class="<?php echo $class ?>" id="t_<? echo $entry->id ?>">
            <td><a href="<? echo $this->baseUrl() ?>/test/edit-test/?test_id=<?php echo $this->escape($entry->id) ?>"><?php echo $this->escape($entry->name) ?></a></td>
            <td class="actions">
                <a href="#" onclick="javascript:actionConfirm('<? echo $this->baseUrl() ?>/test/delete/?test_id=<?php echo $this->escape($entry->id) ?>&go=/level/edit-level/?level_id=<?php echo $this->level_id ?>');"><div class="ui-state-default ui-corner-all" title="Delete" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-trash"></span></div></a>
                <a href="<? echo $this->baseUrl() ?>/test/edit-test/?test_id=<?php echo $this->escape($entry->id) ?>"><div class="ui-state-default ui-corner-all" title="Edit" style="float:left; margin: 3px 3px 0 0;"><span class="ui-icon ui-icon-pencil"></span></div></a>
            </td>
        </tr>
    <?php  endforeach ?>

</tbody>
</table>
</div>